﻿namespace Soleil.Domain.Core.DomainObjects
{
    /// <summary>
    /// interface for versioned entities.
    /// Entities could not be deleted.
    /// An update triggers to create a new Entity.
    /// A delete operation will set the flag IsLatestVersion to false.
    /// </summary>
    public interface IVersionedEntity<TKey> : IAuditableEntity<TKey>
    {
        /// <summary>
        /// Version number.
        /// </summary>
        int Version { get; set; }

        /// <summary>
        /// Whether or not this is the latest version.
        /// </summary>
        /// <returns></returns>
        bool IsLatestVersion { get; set; }
    }
}
